package com.starblink.utils.app

import android.app.Application
import com.apollographql.apollo3.interceptor.ApolloInterceptor
import com.starblink.utils.app.interceptor.ErrorApolloInterceptor
import com.starblink.utils.ext.GuangUtils
import com.starblink.utils.log.SKLogger
import com.starblink.utils.network.base.SKGqlClient
import com.starblink.utils.stroage.SKStorage

class MyApp : Application() {
    override fun onCreate() {
        super.onCreate()
        //初始化工具包
        GuangUtils.init(this)
        //日志初始化
        SKLogger.initLog(this,BuildConfig.DEBUG)

        //网络请求初始化 配置拦截器
        SKGqlClient.getInstance().init(
            "https://pre-guang.starblink.co/graphql",
            listOf<ApolloInterceptor>(ErrorApolloInterceptor()),
            BuildConfig.DEBUG)

        //持久化存储
        SKStorage.initStorage(this)
    }
}